package com.zyf.pattern.observer.subject;

import com.zyf.pattern.observer.core.EventListener;

/**
 * create by yifeng
 */
public class Subject extends EventListener {


    // 通常情况，采用动态代理来实现监控，避免了代码侵入
    public void add() {
        System.out.println("调用add的方法");
        trigger(SubjectEventType.ON_ADD);

    }
    public void remove() {
        trigger(SubjectEventType.ON_REMOVE);
        System.out.println("调用remove方法");
    }
}
